<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/resources/css/statistics/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/resources/css/statistics/font-awesome.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/resources/css/statistics/public.css" />
<title></title>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/resources/js/statistics/bootstrap.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/resources/js/statistics/bootstrap-datetimepicker.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/resources/js/statistics/echarts.min.js"></script>
<script type="text/javascript">
	$(function() {
		document.getElementById("kindType").style.visibility = "hidden";
		document.getElementById("kind").style.visibility = "hidden";
		document.getElementById("type").style.visibility = "hidden";
		//排行榜初始值

	});
	//频道下拉框(饼图)
	$("#channel").change(function() {
		var channelValue = $("#channel").val();
		var kindTypeValue = $("#kindType").val();
		var params = {};
		params["channel"] = channelValue;
		params["kindType"] = kindTypeValue;
		if (channelValue == "全频道") {
			document.getElementById("kindType").style.visibility = "hidden";

		} else {
			document.getElementById("kindType").style.visibility = "visible";
		}

		$.ajax({
			type : "post",
			url : sys.rootPath + '/playstat/binTulistUI.html',
			data : params,
			dataType : "json",
			cache : false,
			error : errorFunction5,//错误执行方法
			success : succFunction5
		//成功执行方法   

		});

	});
	(function(){
		$("#Spread").html("");
		var tableStr="<tr><th class='zb-10'>排名</th><th class='zb-20'>渠道</th><th class='zb-10'>浏览量（pv）</th><th class='zb-10'>占比</th></tr>";
		
		$.ajax({
			type:"post",
			url:sys.rootPath + '/playstat/fromSpreadCount.html',
			dataType:"json",
			success:function(data){
				for(var i=0;i<data.length;i++){
					tableStr+="<tr><td>"+(i+1)+"</td><td>"+data[i]["spreadSupportCode"]+"</td><td>"+data[i]["total"]+"</td><td>"+data[i]["percent"]+"</td></tr>";
				}
				$("#Spread").html(tableStr);
			}
		});
		$("#UrlF").html("");
		tableStr1="<tr><th class='zb-10'>排名</th><th class='zb-20'>入口页面url</th><th class='zb-10'>浏览量（pv）</th><th class='zb-10'>占比</th></tr>";
		
		$.ajax({
			type:"post",
			url:sys.rootPath + '/playstat/fromUrlCount.html',
			dataType:"json",
			success:function(data){
				for(var i=0;i<data.length;i++){
					tableStr1+="<tr><td>"+(i+1)+"</td><td>"+data[i]["browerUrl"]+"</td><td>"+data[i]["total"]+"</td><td>"+data[i]["percent"]+"</td></tr>";
				}
				$("#UrlF").html(tableStr1);
			}
		});
	})();
	//频道二级分类下拉框(饼图)
	$("#kindType").change(function() {
		var channelValue = $("#channel").val();
		var kindTypeValue = $("#kindType").val();
		var params = {};
		params["channel"] = channelValue;
		params["kindType"] = kindTypeValue;
		$.ajax({
			type : "post",
			url : sys.rootPath + '/playstat/binTulistUI.html',
			data : params,
			dataType : "json",
			cache : false,
			error : errorFunction5,//错误执行方法
			success : succFunction5
		//成功执行方法   

		});

	});
	function errorFunction5(data) {
		alert("统计失败");
	};
	function succFunction5(data) {
		var html = "<tr><th>类目</th><th>次数</th></tr>";
		for ( var d in data) {
			html += "<tr><td>" + data[d].name + "<td>" + data[d].value
					+ "</tr>";

		}
		$("#dataList").html(html);

		myChart.setOption({
			series : [ {
				data : data,
			} ]
		});
	};
	//饼图

	var myChart = echarts.init(document.getElementById('main'));
	var option = {
		tooltip : {
			trigger : 'item',
			formatter : "{a} <br/>{b} : {c} ({d}%)"
		},

		series : [ {
			name : '访问来源',
			type : 'pie',
			radius : '70%',
			center : [ '50%', '60%' ],
			/*data :  [{value:335, name:'佳片有约'},
			{value:310, name:'院线大片'},
			{value:234, name:'卫视同步'},
			{value:135, name:'热血动漫'}],*/

			data : (function() {

				var res = [];
				<c:forEach items="${seriesStatList}" var="list">
				res.push({
					name : "${list.channel}",
					value : "${list.playCount}"
				});
				</c:forEach>
				return res;
			})(),

			itemStyle : {
				emphasis : {
					shadowBlur : 10,
					shadowOffsetX : 0,
					shadowColor : 'rgba(0, 0, 0, 0.5)'
				}
			}
		} ]
	};
	myChart.setOption(option);
	//折线图
	var myChart1 = echarts.init(document.getElementById('main1'));

	//checkbox选中事件
	$("#box").change(function() {

		if ($("#box").prop("checked")) {
			var name = document.getElementById('name_pian').value;
			var time = document.getElementById('month_time').value;
			var params = {};
			params["name"] = name;
			params["time"] = time;
			$.ajax({

				type : "post",
				url : sys.rootPath + '/playstat/zheXianlistUI.html',
				data : params,
				dataType : "json",
				cache : false,
				error : errorFunction3,//错误执行方法
				success : succFunction3
			//成功执行方法   

			});

		} else {
			var name = document.getElementById('name_pian').value;
			var time = document.getElementById('month_time').value;
			var params = {};
			params["name"] = name;
			params["time"] = time;
			$.ajax({
				type : "post",
				url : sys.rootPath + '/playstat/zheXianlistUI.html',
				data : params,
				dataType : "json",
				cache : false,
				error : errorFunction4,//错误执行方法
				success : succFunction4
			//成功执行方法   

			});

		}

	});

	function errorFunction3(data) {
		alert("统计失败");
	};

	function succFunction3(data) {
		myChart1.setOption({
			series : [

					{
						name : '前一日浏览量',
						data : [ data.yesterday.yesterday00,
								data.yesterday.yesterday01,
								data.yesterday.yesterday02,
								data.yesterday.yesterday03,
								data.yesterday.yesterday04,
								data.yesterday.yesterday05,
								data.yesterday.yesterday06,
								data.yesterday.yesterday07,
								data.yesterday.yesterday08,
								data.yesterday.yesterday09,
								data.yesterday.yesterday10,
								data.yesterday.yesterday11,
								data.yesterday.yesterday12,
								data.yesterday.yesterday13,
								data.yesterday.yesterday14,
								data.yesterday.yesterday15,
								data.yesterday.yesterday16,
								data.yesterday.yesterday17,
								data.yesterday.yesterday18,
								data.yesterday.yesterday19,
								data.yesterday.yesterday20,
								data.yesterday.yesterday21,
								data.yesterday.yesterday22,
								data.yesterday.yesterday23 ]

					},
					{
						// 根据名字对应到相应的系列
						name : '今日浏览量',
						data : [ data.newToday.today00, data.newToday.today01,
								data.newToday.today02, data.newToday.today03,
								data.newToday.today04, data.newToday.today05,
								data.newToday.today06, data.newToday.today07,
								data.newToday.today08, data.newToday.today09,
								data.newToday.today10, data.newToday.today11,
								data.newToday.today12, data.newToday.today13,
								data.newToday.today14, data.newToday.today15,
								data.newToday.today16, data.newToday.today17,
								data.newToday.today18, data.newToday.today19,
								data.newToday.today20, data.newToday.today21,
								data.newToday.today22, data.newToday.today23 ]

					} ]
		});

	};

	function errorFunction4(data) {
		alert("统计失败");

	};

	function succFunction4(data) {
		myChart1.setOption({
			series : [
					{
						// 根据名字对应到相应的系列
						name : '今日浏览量',
						data : [ data.newToday.today00, data.newToday.today01,
								data.newToday.today02, data.newToday.today03,
								data.newToday.today04, data.newToday.today05,
								data.newToday.today06, data.newToday.today07,
								data.newToday.today08, data.newToday.today09,
								data.newToday.today10, data.newToday.today11,
								data.newToday.today12, data.newToday.today13,
								data.newToday.today14, data.newToday.today15,
								data.newToday.today16, data.newToday.today17,
								data.newToday.today18, data.newToday.today19,
								data.newToday.today20, data.newToday.today21,
								data.newToday.today22, data.newToday.today23 ]

					}, {
						name : '前一日浏览量',
						data : []

					} ]
		});

	};

	option = {

		tooltip : {
			trigger : 'axis'
		},
		legend : {
			data : [ '前一日浏览量', '今日浏览量' ]
		},

		grid : {
			left : '3%',
			right : '4%',
			bottom : '3%',
			containLabel : true
		},
		xAxis : {
			type : 'category',
			boundaryGap : false,
			data : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
					17, 18, 19, 20, 21, 22, 23 ]
		},
		yAxis : {
			type : 'value'
		},
		series : [
				{

					name : '前一日浏览量',
					type : 'line',
					data : []
				},
				{
					name : '今日浏览量',
					type : 'line',
					data : [ '${newToday.today00}', '${newToday.today01}',
							'${newToday.today02}', '${newToday.today03}',
							'${newToday.today04}', '${newToday.today05}',
							'${newToday.today06}', '${newToday.today07}',
							'${newToday.today08}', '${newToday.today09}',
							'${newToday.today10}', '${newToday.today11}',
							'${newToday.today12}', '${newToday.today13}',
							'${newToday.today14}', '${newToday.today15}',
							'${newToday.today16}', '${newToday.today17}',
							'${newToday.today18}', '${newToday.today19}',
							'${newToday.today20}', '${newToday.today21}',
							'${newToday.today22}', '${newToday.today23}' ]
				} ]
	};
	myChart1.setOption(option);

	//日期选择
	$(".form_datetime_2").datetimepicker({
		language : 'zh',
		format : 'yyyy-mm-dd',
		autoclose : true,
		todayBtn : true,
		startView : 'year',
		minView : 'month',
		maxView : 'decade'
	});
	//其它
	$('.onet a').click(function() {
		$('.twot').toggle();
		if ($('.twot').css('display') == 'block') {
			$('.onet span').eq(0).addClass('display-none');
			$('.onet span').eq(1).removeClass('display-none');
		} else {
			$('.onet span').eq(1).addClass('display-none');
			$('.onet span').eq(0).removeClass('display-none');
		}
	});
	$('.twot span').click(function() {
		$(this).addClass('choose').siblings().removeClass('choose');
	});
	//剧集统计排行的今周月总
	$('.pm-f').click(function() {
		$(this).addClass('color-red').siblings().removeClass('color-red');
		var frame = $(this).html();
		//alert($(this).html());

		$("#condition").val(frame);

		var channel2Value = $("#channel2").val();

		var kindValue = $("#kind").val();
		var typeValue = $("#type").val();
		var frameVale = $("#condition").val();

		if (kindValue == "全剧集") {
			kindValue = "";
		}
		if (typeValue == "全剧情") {
			typeValue = "";
		}
		//alert("频道" + channel2Value + "剧集" + kindValue + "剧情"
		//	+ typeValue + "时段 " + frameVale);
		var params = {};
		params["channel"] = channel2Value;
		params["kind"] = kindValue;
		params["type"] = typeValue;
		params["frame"] = frameVale;

		$.ajax({
			type : "post",
			url : sys.rootPath + '/playstat/rankingslistUI.html',
			data : params,
			dataType : "json",
			cache : false,
			error : errorFunction7,//错误执行方法
			success : succFunction7
		//成功执行方法   
		});
	});
	//热剧预告
	$('.pm-f2').click(function() {
		$(this).addClass('color-red').siblings().removeClass('color-red');
		var frame = $(this).html();

		$("#condition2").val(frame);
		var frameVale = $("#condition2").val();
		var params = {};
		params["frame"] = frameVale;
		$.ajax({
			type : "post",
			url : sys.rootPath + '/playstat/hotshowlistUI.html',
			data : params,
			dataType : "json",
			cache : false,
			error : errorFunction8,//错误执行方法
			success : succFunction8
		//成功执行方法   
		});
	});

	//关键词搜索
	//热剧预告
	$('.pm-f3').click(function() {
		$(this).addClass('color-red').siblings().removeClass('color-red');
		var frame = $(this).html();

		$("#condition3").val(frame);
		var frameVale = $("#condition3").val();
		var params = {};
		params["frame"] = frameVale;
		$.ajax({
			type : "post",
			url : sys.rootPath + '/playstat/antistoplistUI.html',
			data : params,
			dataType : "json",
			cache : false,
			error : errorFunction9,//错误执行方法
			success : succFunction9
		//成功执行方法   
		});
	});
	function errorFunction8() {
		alert("统计失败");
	};
	function succFunction8(data) {
		var frameVale = $("#condition2").val();
		var html = "<tr><th>排名</th><th class='jjmc'>剧集名称</th><th>上升指数</th></tr>";

		for (var i = 0; i < data.hotShowList.length; i++) {
			if (frameVale == "日") {

				html += "<tr><td>" + data.hotShowList[i].rankings + "</td><td>"
						+ data.hotShowList[i].seriesName + "</td><td>"
						+ data.hotShowList[i].dayGoupExp + "</td></tr>"
			} else if (frameVale == "周") {

				html += "<tr><td>" + data.hotShowList[i].rankings + "</td><td>"
						+ data.hotShowList[i].seriesName + "</td><td>"
						+ data.hotShowList[i].weekGoupExp + "</td></tr>"
			} else if (frameVale == "月") {

				html += "<tr><td>" + data.hotShowList[i].rankings + "</td><td>"
						+ data.hotShowList[i].seriesName + "</td><td>"
						+ data.hotShowList[i].monthGoupExp + "</td></tr>"
			}

		}

		$("#hotShow").html(html);

	}

	function errorFunction9() {
		alert("统计失败");
	};
	function succFunction9(data) {
		var frameVale = $("#condition3").val();
		var html = "<tr><th>排名</th><th>关键词</th><th>搜索指数</th><th>占比</th></tr>";

		for (var i = 0; i < data.antistopList.length; i++) {
			html += "<tr><td>" + data.antistopList[i].antistopRanking
					+ "</td><td>" + data.antistopList[i].searchWord
					+ "</td><td>" + data.antistopList[i].count 
					+ "</td><td>"+ data.antistopList[i].proportion + "</td></tr>"
		}

		$("#antistop").html(html);

	}

	//搜索事件
	function btnSearch() {
		var name = document.getElementById('btnSearch').value;
		var params = {};
		params["name"] = name;

		$.ajax({
			type : "post",
			url : sys.rootPath + '/playstat/NamelistUI.html',
			data : params,
			dataType : "json",
			cache : false,
			error : errorFunction,//错误执行方法
			success : succFunction
		//成功执行方法   

		});

	};

	//搜索事件

	function btnSearch2() {
		var name = document.getElementById('name_pian').value;
		var time = document.getElementById('month_time').value;
		var params = {};
		params["name"] = name;
		params["time"] = time;
		$.ajax({
			type : "post",
			url : sys.rootPath + '/playstat/zheXianlistUI.html',
			data : params,
			dataType : "json",
			cache : false,
			error : errorFunction2,//错误执行方法
			success : succFunction2
		//成功执行方法   

		});

	};

	function errorFunction() {
		alert("统计失败");

	};
	function errorFunction2() {
		alert("统计失败");
	};
	function succFunction(data) {
		var newDayStat = data.newDayStat; //今天
		var yesterdayStat = data.yesterdayStat;//昨日
		var avgStat = data.avgStat;//平均
		var maxStat = data.maxStat; //最大
		var html = "<table cellpadding='0' cellspacing='0'>";
		html += "<tr><th></th><th>点播总次数</th><th>播放总时长</th><th>评论数</th><th>点赞数</th><th>分享数</th></tr>";
		html += "<tr><td>今日</td><td>" + newDayStat.playCount + "</td><td>"
				+ newDayStat.playTime + "</td><td>" + newDayStat.commentCount
				+ "</td><td>" + newDayStat.likeCount + "</td><td>"
				+ newDayStat.shareCount + "</td></tr>";
		html += "<tr><td>昨日</td><td>" + yesterdayStat.playCount + "</td><td>"
				+ yesterdayStat.playTime + "</td><td>"
				+ yesterdayStat.commentCount + "</td><td>"
				+ yesterdayStat.likeCount + "</td><td>"
				+ yesterdayStat.shareCount + "</td></tr>";
		html += "<tr><td>每日平均</td><td>" + avgStat.playCount + "</td><td>"
				+ avgStat.playTime + "</td><td>" + avgStat.commentCount
				+ "</td><td>" + avgStat.likeCount + "</td><td>"
				+ avgStat.shareCount + "</td></tr>";
		html += "<tr><td>历史峰值</td><td>" + maxStat.playCount + "</td><td>"
				+ maxStat.playTime + "</td><td>" + maxStat.commentCount
				+ "</td><td>" + maxStat.likeCount + "</td><td>"
				+ maxStat.shareCount + "</td></tr>";
		html += "</table>";
		$("#summarize").html(html);
	};

	function succFunction2(data) {
		if ($("#box").prop("checked")) {
			myChart1.setOption({

				series : [

						{
							name : '前一日浏览量',
							data : [ data.yesterday.yesterday00,
									data.yesterday.yesterday01,
									data.yesterday.yesterday02,
									data.yesterday.yesterday03,
									data.yesterday.yesterday04,
									data.yesterday.yesterday05,
									data.yesterday.yesterday06,
									data.yesterday.yesterday07,
									data.yesterday.yesterday08,
									data.yesterday.yesterday09,
									data.yesterday.yesterday10,
									data.yesterday.yesterday11,
									data.yesterday.yesterday12,
									data.yesterday.yesterday13,
									data.yesterday.yesterday14,
									data.yesterday.yesterday15,
									data.yesterday.yesterday16,
									data.yesterday.yesterday17,
									data.yesterday.yesterday18,
									data.yesterday.yesterday19,
									data.yesterday.yesterday20,
									data.yesterday.yesterday21,
									data.yesterday.yesterday22,
									data.yesterday.yesterday23 ]

						},
						{
							// 根据名字对应到相应的系列
							name : '今日浏览量',
							data : [ data.newToday.today00,
									data.newToday.today01,
									data.newToday.today02,
									data.newToday.today03,
									data.newToday.today04,
									data.newToday.today05,
									data.newToday.today06,
									data.newToday.today07,
									data.newToday.today08,
									data.newToday.today09,
									data.newToday.today10,
									data.newToday.today11,
									data.newToday.today12,
									data.newToday.today13,
									data.newToday.today14,
									data.newToday.today15,
									data.newToday.today16,
									data.newToday.today17,
									data.newToday.today18,
									data.newToday.today19,
									data.newToday.today20,
									data.newToday.today21,
									data.newToday.today22,
									data.newToday.today23 ]

						} ]
			});

		} else {
			myChart1.setOption({
				series : [
						{
							// 根据名字对应到相应的系列
							name : '今日浏览量',
							data : [ data.newToday.today00,
									data.newToday.today01,
									data.newToday.today02,
									data.newToday.today03,
									data.newToday.today04,
									data.newToday.today05,
									data.newToday.today06,
									data.newToday.today07,
									data.newToday.today08,
									data.newToday.today09,
									data.newToday.today10,
									data.newToday.today11,
									data.newToday.today12,
									data.newToday.today13,
									data.newToday.today14,
									data.newToday.today15,
									data.newToday.today16,
									data.newToday.today17,
									data.newToday.today18,
									data.newToday.today19,
									data.newToday.today20,
									data.newToday.today21,
									data.newToday.today22,
									data.newToday.today23 ]

						}, {
							name : '前一日浏览量',
							data : []

						} ]
			});
		}

	};
	//频道类型下拉框(剧集点播排名)
	$("#channel2").change(function() {
		$("#kind").val("全剧集");
		$("#type").val("全剧情");
		var channel2Value = $("#channel2").val();
		if (channel2Value == "全频道") {
			document.getElementById("kind").style.visibility = "hidden";
			document.getElementById("type").style.visibility = "hidden";
		} else {

			document.getElementById("kind").style.visibility = "visible";
			document.getElementById("type").style.visibility = "visible";
		}
		var kindValue = $("#kind").val();
		var typeValue = $("#type").val();
		var frameVale = $("#condition").val();
		//alert("频道" + channel2Value + "剧集" + kindValue + "剧情"
		//+ typeValue + "时段 " + frameVale);
		if (kindValue == "全剧集") {

			kindValue = "";
		}
		if (typeValue == "全剧情") {
			typeValue = "";
		}
		var params = {};
		params["channel"] = channel2Value;
		params["kind"] = kindValue;
		params["type"] = typeValue;
		params["frame"] = frameVale;
		$.ajax({
			type : "post",
			url : sys.rootPath + '/playstat/rankingslistUI.html',
			data : params,
			dataType : "json",
			cache : false,
			error : errorFunction6,//错误执行方法
			success : succFunction6
		//成功执行方法   

		});

	});

	//剧集类型下拉框(剧集点播排名)
	$("#kind").change(function() {
		var channel2Value = $("#channel2").val();

		var kindValue = $("#kind").val();
		var typeValue = $("#type").val();
		var frameVale = $("#condition").val();
		//alert("频道" + channel2Value + "剧集" + kindValue + "剧情"
		//+ typeValue + "时段 " + frameVale);
		if (kindValue == "全剧集") {

			kindValue = "";
		}
		if (typeValue == "全剧情") {
			typeValue = "";
		}
		var params = {};
		params["channel"] = channel2Value;
		params["kind"] = kindValue;
		params["type"] = typeValue;
		params["frame"] = frameVale;
		$.ajax({
			type : "post",
			url : sys.rootPath + '/playstat/rankingslistUI.html',
			data : params,
			dataType : "json",
			cache : false,
			error : errorFunction7,//错误执行方法
			success : succFunction7
		//成功执行方法   

		});

	});

	//剧情类型下拉框(剧集点播排名)
	$("#type").change(function() {
	
		var channel2Value = $("#channel2").val();

		var kindValue = $("#kind").val();
		var typeValue = $("#type").val();
		var frameVale = $("#condition").val();
		/* 	alert("频道" + channel2Value + "，剧集" + kindValue + "，剧情"
		+ typeValue + "，时段 " + frameVale); */
		if (kindValue == "全剧集") {

			kindValue = "";
		}
		if (typeValue == "全剧情") {
			typeValue = "";
		}
		var params = {};
		params["channel"] = channel2Value;
		params["kind"] = kindValue;
		params["type"] = typeValue;
		params["frame"] = frameVale;

		$.ajax({
			type : "post",
			url : sys.rootPath + '/playstat/rankingslistUI.html',
			data : params,
			dataType : "json",
			cache : false,
			error : errorFunction7,//错误执行方法
			success : succFunction7
		//成功执行方法   

		});

	});

	function succFunction6(data) {
		var kind = "<option selected>全剧集</option>";
		var type = "<option selected>全剧情</option>";
		var frameVale = $("#condition").val();
		var ranking = "<tr><th>排名</th><th class='jjmc'>剧集名称</th><th>点播数</th></tr>";
		for (var i = 0; i < data.kind.length; i++) {
			kind += "<option value="+data.kind[i].kind+">" + data.kind[i].name
					+ "</option>";

		}

		for (var i = 0; i < data.type.length; i++) {
			type += "<option value="+data.type[i].type+">" + data.type[i].name
					+ "</option>";
		}

		for (var i = 0; i < data.ranking.length; i++) {
			var rkname1 = data.ranking[i].seriesName;
			var rk1 = parseInt(data.ranking[i].rankings);
			if (frameVale == "日") {
				ranking += "<tr><td>" + data.ranking[i].rankings;

				var rk = parseInt(data.ranking[i].risingIndex);
				//当前剧集排名比24小时之前提高
				if (rk > 0) {
					ranking += "<span class='fa fa-long-arrow-up pm color-3' aria-hidden='true'></span></td>";
					//当前剧集排名比24小时之前不变
				} else if (rk == 0) {
					ranking += "<span class='fa fa-arrows-h pm color-9' aria-hidden='true'></span></td>";
					//当前剧集排名比24小时之前下降 
				} else if (rk < 0) {
					ranking += "<span class='fa fa-long-arrow-down pm color-8' aria-hidden='true'></span></td>";
				}
				//当前所有剧集在昨天都没有浏览量 排名肯定上升
				ranking += "<td>" + data.ranking[i].seriesName + "</td><td>"
						+ data.ranking[i].playCount + "</td></tr>";
			} else {
				ranking += "<tr><td>" + data.ranking[i].rankings + "</td><td>"
						+ data.ranking[i].seriesName + "</td><td>"
						+ data.ranking[i].playCount + "</td></tr>";
			}

		}
		$("#kind").html(kind);
		$("#type").html(type);
		$("#ranking").html(ranking);
	};

	function errorFunction6(data) {
		alert("错误");
	};

	function succFunction7(data) {
		var frameVale = $("#condition").val();
		var ranking = "<tr><th>排名</th><th class='jjmc'>剧集名称</th><th>点播数</th></tr>";
		for (var i = 0; i < data.ranking.length; i++) {
			if (frameVale == "日") {
				ranking += "<tr><td>" + data.ranking[i].rankings;
				var rk = parseInt(data.ranking[i].risingIndex);
				//当前剧集排名比24小时之前提高
				if (rk > 0) {
					ranking += "<span class='fa fa-long-arrow-up pm color-3' aria-hidden='true'></span></td>";
					//当前剧集排名比24小时之前不变
				} else if (rk == 0) {
					ranking += "<span class='fa fa-arrows-h pm color-9' aria-hidden='true'></span></td>";
					//当前剧集排名比24小时之前下降 
				} else if (rk < 0) {
					ranking += "<span class='fa fa-long-arrow-down pm color-8' aria-hidden='true'></span></td>";
				}

				ranking += "<td>" + data.ranking[i].seriesName + "</td><td>"
						+ data.ranking[i].playCount + "</td></tr>";

			} else {

				ranking += "<tr><td>" + data.ranking[i].rankings + "</td><td>"
						+ data.ranking[i].seriesName + "</td><td>"
						+ data.ranking[i].playCount + "</td></tr>";
			}

		}
		$("#ranking").html(ranking);
	};

	function errorFunction7(data) {
		alert("错误");
	};
</script>


</head>
<body>

	<div class="count">
		<div class="right">
			<div class="bd">
				<div class="title-h">
					<span class="bigtitle">平台概况</span>
					<button type="button" class="btn btn-primary" onClick="btnSearch()"
						style="width: 70px; float: right; color: #fff; margin-left: 10px;">
						搜索</button>
					<input id="btnSearch" type="text" placeholder="片名"
						class="sousuo form-control" />
				</div>
				<div class="contentx" id="summarize">
					<table cellpadding="0" cellspacing="0">
						<tr>
							<th></th>
							<th>点播总次数</th>
							<th>播放总时长</th>
							<th>评论数</th>
							<th>点赞数</th>
							<th>分享数</th>
						</tr>
						<tr>
							<td>今日</td>
							<td>${newDayStat.playCount}</td>
							<td>${newDayStat.playTime}</td>
							<td>${newDayStat.commentCount}</td>
							<td>${newDayStat.likeCount}</td>
							<td>${newDayStat.shareCount}</td>
						</tr>
						<tr>
							<td>昨日</td>
							<td>${yesterdayStat.playCount}</td>
							<td>${yesterdayStat.playTime}</td>
							<td>${yesterdayStat.commentCount}</td>
							<td>${yesterdayStat.likeCount}</td>
							<td>${yesterdayStat.shareCount}</td>
						</tr>
						<tr>
							<td>每日平均</td>
							<td>${avgStat.playCount}</td>
							<td>${avgStat.playTime}</td>
							<td>${avgStat.commentCount}</td>
							<td>${avgStat.likeCount}</td>
							<td>${avgStat.shareCount}</td>
						</tr>
						<tr>
							<td>历史峰值</td>
							<td>${maxStat.playCount}</td>
							<td>${maxStat.playTime}</td>
							<td>${maxStat.commentCount}</td>
							<td>${maxStat.likeCount}</td>
							<td>${maxStat.shareCount}</td>
						</tr>
					</table>
				</div>
			</div>

			<div class="bd">
				<div class="title-h">
					<span class="bigtitle">各时段播放次数</span> <span class="duibi"><button
							type="button" class="btn btn-primary" onClick="btnSearch2()"
							style="width: 70px; float: right; color: #fff; margin-left: 10px;">
							搜索</button>对比 <input id="box" type="checkbox" /> 前一日 </span> <input type="text"
						class="form-control form_datetime_2 sousuo" readonly
						id="month_time" value="${newTodayTime}" placeholder="日期选择" /> <input
						type="text" id="name_pian" placeholder="片名" value=""
						class="sousuo form-control" />
					<!--<input type="text" id="todayTime"
						placeholder="当前日期" value="${newTodayTime}" /> <input type="text"
						id="yesterdayTime" placeholder="当前日期前一天" value="${yesterdayTime}" />  -->
				</div>
				<div class="contentx">
					<div id="main1" style="width: 100%; height: 400px;"></div>
				</div>
			</div>
			<div class="bd">
				<div class="bd width-h">
					<div class="title-h">
						<span class="bigtitle">频道播放统计</span>
					</div>
					<div class="contentx">
						<div class="sec-con">
							<select class="form-control" id="channel">
								<option selected="selected">全频道</option>
								<c:forEach items="${channelList}" var="list">
									<option>${list.name}</option>
								</c:forEach>
							</select> <select class="form-control" id="kindType">
								<option>剧集分类</option>
								<option>剧情分类</option>
							</select>
						</div>
						<div style="max-height: 365px; width: 100%; overflow: auto;">
							<table cellpadding="0" cellspacing="0" id="dataList">
								<tr>
									<th>类目</th>
									<th>次数</th>
								</tr>
								<c:forEach items="${seriesStatList}" var="list">
									<tr>
										<td class="color-b">${list.channel}</td>
										<td>${list.playCount}</td>
									</tr>
								</c:forEach>
							</table>
						</div>
						<div id="main" style="width: 100%; height: 450px;"></div>
					</div>
				</div>

				<div class="bd width-h float-r">
					<div class="title-h">
						<span class="bigtitle">剧集点播排名</span>
						<div class="float-r" style="margin-right: 5px;">
							<span class="pm-f color-red">日</span> · <span class="pm-f">周</span>
							· <span class="pm-f">月</span> · <span class="pm-f">总</a>
						</div>
						<input id="condition" input type="hidden" placeholder="搜索条件"
							value="日" />
					</div>
					<div class="contentx">
						<div class="sec-con">
							<select class="form-control" id="channel2">
								<option selected="selected">全频道</option>
								<c:forEach items="${channelList}" var="list">
									<option>${list.name}</option>
								</c:forEach>
							</select> <select class="form-control" id="kind">
								<option selected="selected">全剧集</option>
								<option>剧集分类</option>
							</select> </select> <select class="form-control" id="type">
								<option selected="selected">全剧情</option>
								<option>剧情分类</option>
							</select>
						</div>

						<table cellpadding="0" cellspacing="0" id="ranking">
							<tr>
								<th>排名</th>
								<th class="jjmc">剧集名称</th>
								<th>点播数</th>
							</tr>
							<c:forEach items="${rankingList}" var="list">
								<tr>

									<c:if test="${list.risingIndex lt 0}">
										<td>${list.rankings}<span
											class="fa fa-long-arrow-down pm color-8" aria-hidden="true"></span></td>
									</c:if>

									<c:if test="${list.risingIndex eq 0}">
										<td>${list.rankings}<span
											class="fa fa-arrows-h pm color-9" aria-hidden="true"></span></td>
									</c:if>

									<c:if test="${list.risingIndex gt 0}">
										<td>${list.rankings}<span
											class="fa fa-long-arrow-up pm color-3" aria-hidden="true"></span></td>
									</c:if>
									<td>${list.seriesName}</td>
									<td>${list.playCount}</td>
								</tr>


							</c:forEach>

						</table>
					</div>
				</div>
			</div>

			<div class="bd">
				<div class="bd width-h">
					<div class="title-h">
						<span class="bigtitle">热剧预告</span> <span> 近一周点播排名增长较快 </span>
					</div>
					<div class="float-r" style="margin-right: 5px;">
						<span class="pm-f2 color-red">日</span> · <span class="pm-f2">周</span>
						· <span class="pm-f2">月</span></a>
					</div>
					<input id="condition2" input type="hidden" placeholder="搜索条件"
						value="日" />
					<div class="contentx">
						<table cellpadding="0" cellspacing="0" id="hotShow">
							<tr>
								<th>排名</th>
								<th class="jjmc">剧集名称</th>
								<th>上升指数</th>
							</tr>
							<c:forEach items="${risingIndexRK}" var="list">
								<tr>
									<td>${list.rankings}</td>
									<td>${list.seriesName}</td>
									<td>${list.dayGoupExp}</td>
								</tr>
							</c:forEach>
						</table>
					</div>
				</div>
				<div class="bd width-h float-r">
					<div class="title-h">
						<span class="bigtitle">搜索关键词统计</span>
						<div class="float-r" style="margin-right: 5px;">
							<span class="pm-f3 color-red">日</span> · <span class="pm-f3">周</span>
							· <span class="pm-f3">月</span> · <span class="pm-f3">总</a>
						</div>
					</div>
					<input id="condition3" input type="hidden" placeholder="搜索条件"
						value="日" />
					<div class="contentx">
						<table cellpadding="0" cellspacing="0" id="antistop">
							<tr>
								<th>排名</th>
								<th>关键词</th>
								<th>搜索指数</th>
								<th>占比</th>
							</tr>
							<c:forEach items="${antistopList}" var="list">
								<tr>
									<td>${list.antistopRanking}</td>
									<td>${list.searchWord}</td>
									<td>${list.count}</td>
									<td>${list.proportion}</td>
								</tr>
							</c:forEach>
						</table>
					</div>
				</div>
			</div>

			<div class="bd">
				<div class="title-h">
					<span class="bigtitle">来源渠道统计</span>
				</div>
				<div class="contentx">
					<table id="Spread" cellpadding="0" cellspacing="0">
						<tr>
							<th class="zb-10">排名</th>
							<th class="zb-20">渠道</th>
							<th class="zb-20">浏览量（pv）</th>
							<th class="zb-10">占比</th>
						</tr>
						<tr>
							<td>1</td>
							<td></td>
							<td></td>
							<td></td>
						</tr>
					</table>
				</div>
			</div>
			
			<div class="bd">
				<div class="title-h">
					<span class="bigtitle">入口页面URL统计</span>
				</div>
				<div class="contentx">
					<table id="UrlF" cellpadding="0" cellspacing="0">
						<tr>
							<th class="zb-10">排名</th>
							<th class="zb-20">入口页面url</th>
							<th class="zb-20">浏览量（pv）</th>
							<th class="zb-10">占比</th>
						</tr>
						<tr>
							<td>1</td>
							<td></td>
							<td></td>
							<td></td>
						</tr>
					</table>
				</div>
			</div>
		</div>
	</div>
</body>
</html>